/**
 * <pre>
 * Title: 		ArticleCategory.java
 * Author:		linriqing
 * Create:	 	2010-7-30 下午05:36:44
 * Copyright: 	Copyright (c) 2010
 * Company:		Shenzhen Helper
 * <pre>
 */
package com.hengpeng.itfinbase.persist;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.hengpeng.common.persist.entity.AbstractTableAutoIdEntity;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputType;
import com.hengpeng.itfinbase.CacheType;

/**
 * <pre>
 * 文章类别
 * </pre>
 * @author linriqing
 * @version 1.0, 2010-7-30
 */
@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = CacheType.SECOND_CACHE_DEFAULT)
public class ArticleCategory extends AbstractTableAutoIdEntity
{
	private static final long serialVersionUID = -3396641573924802861L;

	@HtmlInput(label = "描述", type = HtmlInputType.TEXT, index = 2, nullable = false)
	@Column(length = 50)
	private String description;

	@HtmlInput(label = "名称", type = HtmlInputType.TEXT, index = 1, nullable = false)
	@Column(length = 50)
	private String name;

	// @HtmlInput(label = "父类别", type = HtmlInputType.TEXT, nullable = false, labelProperty = "name", valueProperty =
	// "id")
	@OneToOne(fetch = FetchType.EAGER)
	private ArticleCategory parent;

	public String getDescription()
	{
		return description;
	}

	public String getName()
	{
		return name;
	}

	public ArticleCategory getParent()
	{
		return parent;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public void setParent(ArticleCategory category)
	{
		this.parent = category;
	}
}
